<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1-3-5清单时间管理法 - 职场观察者知识库</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/lucide@latest"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&family=Source+Han+Sans+CN:wght@300;400;700&display=swap" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        'highlight-bg': '#EFF6FF',
                        'highlight-text': '#1E40AF',
                    }
                }
            }
        }
    </script>
    <style>
        :root {
            --theme-primary: #3B82F6;
            --theme-secondary: #10B981;
            --highlight-bg: #EFF6FF;
            --highlight-text: #1E40AF;
        }
        body {
            font-family: 'Source Han Sans CN', sans-serif;
            font-weight: 300;
        }
        h1, h2, h3, blockquote {
            font-family: 'Noto Serif SC', serif;
        }
        .magazine-page {
            width: 700px;
            background: #fefefe;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: auto;
        }
        .dark .magazine-page {
            background: #111827;
        }
        .dark p {
            color: #d1d5db;
        }
        .dark h1, .dark h2, .dark h3 {
            color: #f9fafb;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 4em;
            line-height: 0.8;
            margin: 0.1em 0.1em 0 0;
            font-weight: 700;
            font-family: 'Noto Serif SC', serif;
        }
        .breathing-space {
            letter-spacing: 0.05em;
            line-height: 1.8;
        }
        .sop-table {
            border-collapse: collapse;
            width: 100%;
            margin-bottom: 1.5rem;
        }
        .sop-table th, .sop-table td {
            border: 1px solid #e5e7eb;
            padding: 0.75rem;
            text-align: left;
        }
        .sop-table th {
            background-color: #f9fafb;
            font-weight: 600;
        }
        .editable {
            min-height: 80px;
            padding: 1rem;
            border: 1px dashed #d1d5db;
            border-radius: 0.5rem;
            transition: all 0.3s ease;
            width: 100%;
        }
        .editable:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
            background-color: #f8fafc;
        }
        .sop-card {
            background: white;
            border-radius: 0.5rem;
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        .sop-card h3 {
            color: #1e40af;
            border-bottom: 2px solid #e5e7eb;
            padding-bottom: 0.5rem;
            margin-bottom: 1rem;
        }
        .method-explanation {
            background-color: #f0f9ff;
            border-left: 4px solid #3b82f6;
            padding: 1rem;
            margin-bottom: 1.5rem;
            border-radius: 0 0.5rem 0.5rem 0;
        }
        .input-hint {
            font-size: 0.75rem;
            color: #6b7280;
            margin-top: 0.25rem;
        }
        .save-indicator {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background-color: #10b981;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .save-indicator.show {
            opacity: 1;
        }
        .task-section {
            margin-bottom: 2rem;
            padding-bottom: 1.5rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .task-section:last-child {
            border-bottom: none;
        }
        .section-title {
            font-weight: 600;
            color: #1e40af;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            font-size: 1.125rem;
        }
        .section-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            color: white;
            border-radius: 50%;
            margin-right: 0.75rem;
        }
        .list-header {
            background: linear-gradient(135deg, #3b82f6, #1e40af);
            color: white;
            padding: 1.5rem;
            border-radius: 0.5rem;
            margin-bottom: 1.5rem;
        }
        .list-header h2 {
            color: white;
            margin-bottom: 0.5rem;
        }
        .date-input {
            background: rgba(255, 255, 255, 0.9);
            color: #1f2937;
            padding: 0.75rem;
            border-radius: 0.375rem;
            min-height: 50px;
            border: 1px dashed rgba(59, 130, 246, 0.5);
        }
        .date-input:focus {
            outline: none;
            border-color: white;
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
        }
        .export-buttons {
            display: flex;
            justify-content: center;
            gap: 1rem;
            margin-top: 2rem;
            margin-bottom: 1rem;
        }
        .task-item {
            display: flex;
            align-items: flex-start;
            margin-bottom: 1rem;
        }
        .task-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            background-color: #3b82f6;
            color: white;
            border-radius: 50%;
            margin-right: 0.75rem;
            font-weight: bold;
            font-size: 0.875rem;
            flex-shrink: 0;
        }
        .task-content {
            flex: 1;
        }
        .completion-status {
            display: flex;
            align-items: center;
            margin-top: 0.5rem;
        }
        .completion-checkbox {
            margin-right: 0.5rem;
        }
    </style>
</head>
<body class="bg-gray-100 dark:bg-gray-800 flex items-center justify-center min-h-screen p-4 md:p-8">
    <article class="magazine-page shadow-2xl p-8">
        <!-- 页面头部 -->
        <header class="mb-8">
            <h1 class="text-3xl font-bold leading-tight mb-2 relative">
                <span class="absolute left-0 -top-2 bottom-2 w-1.5 bg-primary rounded-full"></span>
                <span class="ml-6">1-3-5清单时间管理法</span>
            </h1>
            <p class="text-lg text-gray-600 dark:text-gray-400 font-light ml-6">精细化管理时间，提高工作效率</p>
        </header>

        <!-- 方法说明 -->
        <div class="method-explanation">
            <h3 class="font-bold text-primary mb-2">方法简介</h3>
            <p class="text-gray-700">1-3-5清单是一种精细化的时间管理方法，通过将任务按时间需求分类，帮助您合理规划工作节奏，确保重要任务得到充分关注，同时高效利用碎片时间。</p>
        </div>

        <!-- 1-3-5清单 -->
        <div id="sop-content">
            <div class="sop-card">
                <h3 class="text-xl font-bold flex items-center">
                    <i data-lucide="list-checks" class="w-6 h-6 mr-2 text-primary"></i>
                    1-3-5清单
                </h3>
                
                <!-- 清单日期 -->
                <div class="list-header">
                    <h2 class="text-xl font-bold flex items-center">
                        <i data-lucide="calendar" class="w-5 h-5 mr-2"></i>
                        清单日期
                    </h2>
                    <div class="date-input mt-3" contenteditable="true" data-placeholder="请在此处填写清单日期..."></div>
                </div>
                
                <!-- 1件2小时以上任务 -->
                <div class="task-section">
                    <div class="section-title">
                        <span class="section-icon" style="background-color: #3B82F6;">
                            <i data-lucide="clock" class="w-5 h-5"></i>
                        </span>
                        <span>1件2个小时以上才能完成的任务</span>
                    </div>
                    <div class="input-hint mb-3">这是需要专注和长时间投入的核心任务</div>
                    
                    <div class="task-item">
                        <span class="task-number">1</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="最重要的大任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 3件30分钟任务 -->
                <div class="task-section">
                    <div class="section-title">
                        <span class="section-icon" style="background-color: #10B981;">
                            <i data-lucide="zap" class="w-5 h-5"></i>
                        </span>
                        <span>3件30分钟就能完成的任务</span>
                    </div>
                    <div class="input-hint mb-3">这些是需要中等时间投入的重要任务</div>
                    
                    <div class="task-item">
                        <span class="task-number">1</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第一件中等任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="task-item">
                        <span class="task-number">2</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第二件中等任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="task-item">
                        <span class="task-number">3</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第三件中等任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 5件15分钟任务 -->
                <div class="task-section">
                    <div class="section-title">
                        <span class="section-icon" style="background-color: #F59E0B;">
                            <i data-lucide="check-circle" class="w-5 h-5"></i>
                        </span>
                        <span>5件15分钟就能完成的任务</span>
                    </div>
                    <div class="input-hint mb-3">这些是可以利用碎片时间快速完成的小任务</div>
                    
                    <div class="task-item">
                        <span class="task-number">1</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第一件小任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="task-item">
                        <span class="task-number">2</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第二件小任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="task-item">
                        <span class="task-number">3</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第三件小任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="task-item">
                        <span class="task-number">4</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第四件小任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="task-item">
                        <span class="task-number">5</span>
                        <div class="task-content">
                            <div class="editable" contenteditable="true" data-placeholder="第五件小任务..."></div>
                            <div class="completion-status">
                                <input type="checkbox" class="completion-checkbox">
                                <span class="text-sm text-gray-500">已完成</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 完成情况 -->
                <div class="task-section">
                    <div class="section-title">
                        <span class="section-icon" style="background-color: #EF4444;">
                            <i data-lucide="bar-chart" class="w-5 h-5"></i>
                        </span>
                        <span>完成情况总结</span>
                    </div>
                    <div class="editable" contenteditable="true" data-placeholder="记录任务完成情况、遇到的问题或调整计划..."></div>
                    <div class="input-hint">记录实际完成情况，分析未完成任务的原因，调整明天的计划</div>
                </div>
            </div>
            
            <!-- 使用提示 -->
            <div class="sop-card bg-yellow-50 border border-yellow-200">
                <h3 class="text-lg font-bold text-yellow-800 flex items-center">
                    <i data-lucide="lightbulb" class="w-5 h-5 mr-2"></i>
                    使用提示
                </h3>
                <ul class="text-yellow-700 text-sm list-disc pl-5 space-y-1">
                    <li>每天开始工作前制定1-3-5清单，明确当天任务优先级</li>
                    <li>将最重要的1件大任务安排在精力最充沛的时间段</li>
                    <li>利用专注时间段完成3件中等任务</li>
                    <li>利用碎片时间完成5件小任务，提高时间利用率</li>
                    <li>每天结束时回顾完成情况，为第二天制定更合理的计划</li>
                    <li>写的时候不要过于注重格式排版，而应注重内容</li>
                </ul>
            </div>
            
            <!-- 导出按钮 - 放在最后 -->
            <div class="export-buttons">
                <button id="export-pdf" class="bg-red-500 hover:bg-red-600 text-white font-medium py-2 px-4 rounded-lg transition duration-300 flex items-center">
                    <i data-lucide="file-text" class="w-5 h-5 mr-2"></i>
                    导出为PDF
                </button>
                <button id="export-doc" class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg transition duration-300 flex items-center">
                    <i data-lucide="download" class="w-5 h-5 mr-2"></i>
                    导出为文档
                </button>
            </div>
        </div>

        <!-- 页面底部信息 -->
        <div class="flex items-center text-green-600 mt-8 pt-6 border-t border-gray-200 dark:border-gray-700">
            <i data-lucide="check-circle" class="w-5 h-5 mr-2"></i>
            <span>1-3-5清单 · 职场观察者知识库</span>
        </div>
        
        <!-- 保存提示 -->
        <div id="save-indicator" class="save-indicator">
            <i data-lucide="check" class="w-4 h-4 mr-1 inline"></i>
            内容已自动保存
        </div>
    </article>

    <script>
        // 初始化Lucide图标
        lucide.createIcons();
        
        // 设置占位符文本
        document.querySelectorAll('.editable, .date-input').forEach(editable => {
            const placeholder = editable.getAttribute('data-placeholder');
            if (placeholder && !editable.textContent.trim()) {
                editable.textContent = placeholder;
                editable.classList.add('text-gray-400');
            }
            
            editable.addEventListener('focus', function() {
                if (this.textContent === this.getAttribute('data-placeholder')) {
                    this.textContent = '';
                    this.classList.remove('text-gray-400');
                }
            });
            
            editable.addEventListener('blur', function() {
                if (!this.textContent.trim()) {
                    this.textContent = this.getAttribute('data-placeholder');
                    this.classList.add('text-gray-400');
                }
            });
            
            // 自动保存功能
            editable.addEventListener('input', function() {
                clearTimeout(this.saveTimeout);
                this.saveTimeout = setTimeout(() => {
                    showSaveIndicator();
                }, 1000);
            });
        });
        
        // 设置复选框功能
        document.querySelectorAll('.completion-checkbox').forEach(checkbox => {
            checkbox.addEventListener('change', function() {
                const taskContent = this.closest('.task-content');
                const editable = taskContent.querySelector('.editable');
                
                if (this.checked) {
                    editable.style.textDecoration = 'line-through';
                    editable.style.opacity = '0.7';
                } else {
                    editable.style.textDecoration = 'none';
                    editable.style.opacity = '1';
                }
                
                showSaveIndicator();
            });
        });
        
        // 显示保存提示
        function showSaveIndicator() {
            const indicator = document.getElementById('save-indicator');
            indicator.classList.add('show');
            setTimeout(() => {
                indicator.classList.remove('show');
            }, 2000);
        }
        
        // 导出为PDF功能
        document.getElementById('export-pdf').addEventListener('click', function() {
            const { jsPDF } = window.jspdf;
            
            // 获取要导出的内容
            const element = document.getElementById('sop-content');
            
            // 临时移除占位符文本
            document.querySelectorAll('.editable, .date-input').forEach(editable => {
                if (editable.textContent === editable.getAttribute('data-placeholder')) {
                    editable.textContent = '';
                }
            });
            
            // 使用html2canvas将内容转换为图片
            html2canvas(element, {
                scale: 2,
                useCORS: true,
                logging: false
            }).then(canvas => {
                const imgData = canvas.toDataURL('image/png');
                const pdf = new jsPDF('p', 'mm', 'a4');
                const imgWidth = 190; // 页面宽度
                const pageHeight = 277; // A4高度
                const imgHeight = canvas.height * imgWidth / canvas.width;
                let heightLeft = imgHeight;
                let position = 10;
                
                pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight);
                heightLeft -= pageHeight;
                
                // 如果内容超过一页，添加新页面
                while (heightLeft >= 0) {
                    position = heightLeft - imgHeight + 10;
                    pdf.addPage();
                    pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight);
                    heightLeft -= pageHeight;
                }
                
                pdf.save('1-3-5清单.pdf');
                
                // 恢复占位符文本
                document.querySelectorAll('.editable, .date-input').forEach(editable => {
                    if (!editable.textContent.trim()) {
                        editable.textContent = editable.getAttribute('data-placeholder');
                        editable.classList.add('text-gray-400');
                    }
                });
            });
        });

        // 导出为文档功能
        document.getElementById('export-doc').addEventListener('click', function() {
            // 创建一个临时的div来保存格式化内容
            const tempDiv = document.createElement('div');
            tempDiv.innerHTML = document.getElementById('sop-content').innerHTML;
            
            // 获取所有可编辑区域的内容
            const editables = tempDiv.querySelectorAll('[contenteditable="true"]');
            editables.forEach(editable => {
                // 移除contenteditable属性
                editable.removeAttribute('contenteditable');
                // 如果内容是占位符，清空
                if (editable.textContent === editable.getAttribute('data-placeholder')) {
                    editable.textContent = '';
                }
                // 添加样式以保持格式
                editable.style.border = '1px solid #ddd';
                editable.style.padding = '8px';
                editable.style.minHeight = '40px';
                editable.style.marginBottom = '10px';
            });
            
            // 创建HTML内容
            const htmlContent = `
                <!DOCTYPE html>
                <html>
                <head>
                    <meta charset="UTF-8">
                    <title>1-3-5清单</title>
                    <style>
                        body { 
                            font-family: 'Source Han Sans CN', sans-serif; 
                            margin: 20px;
                            color: #333;
                        }
                        h1, h2, h3 { 
                            font-family: 'Noto Serif SC', serif; 
                            color: #1e40af;
                        }
                        h1 { font-size: 24px; border-bottom: 2px solid #1e40af; padding-bottom: 10px; }
                        h3 { font-size: 18px; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
                        .task-section { 
                            margin-bottom: 20px; 
                            padding-bottom: 15px;
                            border-bottom: 1px solid #e5e7eb;
                        }
                        .section-title {
                            font-weight: 600;
                            color: #1e40af;
                            margin-bottom: 10px;
                            font-size: 1.125rem;
                        }
                        .list-header {
                            background: linear-gradient(135deg, #3b82f6, #1e40af);
                            color: white;
                            padding: 15px;
                            border-radius: 5px;
                            margin-bottom: 20px;
                        }
                        .list-header h2 {
                            color: white;
                            margin-bottom: 10px;
                        }
                        .date-input {
                            background: rgba(255, 255, 255, 0.9);
                            color: #1f2937;
                            padding: 10px;
                            border-radius: 5px;
                            min-height: 40px;
                            border: 1px dashed rgba(59, 130, 246, 0.5);
                        }
                        .sop-card { 
                            margin-bottom: 30px; 
                            padding: 20px; 
                            border: 1px solid #ddd; 
                            border-radius: 5px; 
                        }
                        .method-explanation {
                            background-color: #f0f9ff;
                            border-left: 4px solid #3b82f6;
                            padding: 15px;
                            margin-bottom: 20px;
                        }
                        .export-buttons {
                            display: flex;
                            justify-content: center;
                            gap: 10px;
                            margin-top: 20px;
                            margin-bottom: 10px;
                        }
                        .task-item {
                            display: flex;
                            align-items: flex-start;
                            margin-bottom: 15px;
                        }
                        .task-number {
                            display: inline-flex;
                            align-items: center;
                            justify-content: center;
                            width: 24px;
                            height: 24px;
                            background-color: #3b82f6;
                            color: white;
                            border-radius: 50%;
                            margin-right: 10px;
                            font-weight: bold;
                            font-size: 0.75rem;
                            flex-shrink: 0;
                        }
                        .task-content {
                            flex: 1;
                        }
                        .completion-status {
                            display: flex;
                            align-items: center;
                            margin-top: 5px;
                        }
                        .completion-checkbox {
                            margin-right: 5px;
                        }
                    </style>
                </head>
                <body>
                    <h1>1-3-5清单</h1>
                    <div class="method-explanation">
                        <h3>方法简介</h3>
                        <p>1-3-5清单是一种精细化的时间管理方法，通过将任务按时间需求分类，帮助您合理规划工作节奏，确保重要任务得到充分关注，同时高效利用碎片时间。</p>
                    </div>
                    ${tempDiv.innerHTML}
                </body>
                </html>
            `;
            
            // 创建Blob并下载
            const blob = new Blob([htmlContent], { type: 'application/msword' });
            const url = URL.createObjectURL(blob);
            const a = document.createElement('a');
            a.href = url;
            a.download = '1-3-5清单.doc';
            document.body.appendChild(a);
            a.click();
            document.body.removeChild(a);
            URL.revokeObjectURL(url);
        });
    </script>
</body>
</html>